package com.test.metric.queue;

import java.util.concurrent.BlockingQueue;

public class MetricReceiver implements Runnable{

private final BlockingQueue<String> queue;
	
	public MetricReceiver(BlockingQueue<String> queue){
		this.queue=queue;
	}
	
	public void run() {
		while (true) {
			try {
				String data = queue.take();
				System.out.println(Thread.currentThread().getName()+ " Receive: " + data);
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}

	}
}
